
public class Point {

	private double posX;
	
	private double posY;
 
	public Point(double posX, double posY) {
		super();
		this.posX = posX;
		this.posY = posY;
	}

	public double getPosX() {
		return posX;
	}

	public void setPosX(double posX) {
		this.posX = posX;
	}

	public double getPosY() {
		return posY;
	}

	public void setPosY(double posY) {
		this.posY = posY;
	}
	
	public boolean withinRange(double x, double y, double radius){
		return distance(x,y)<radius;
	}
	
	public double distance(double x, double y){
		double r1 = x-posX;
		r1*=r1;
		double r2 = y-posY;
		r2*=r2;
		return Math.sqrt(r1+r2);
	}
	
	public String toString(){
		return "x: "+posX+" y: "+posY;
	}
	
}
